
window.mySwipe = new Swipe(document.getElementById('slider'), {
  startSlide: 0,
  speed: 400,
  auto: 3000,
  continuous: true,
  disableScroll: false,
  stopPropagation: false,
  callback: function(index, elem) {
    
                
                slideTab(index);

  },
  transitionEnd: function(index, elem) {

  },

});
//点击数字跳转到响应的面板
var bullets = document.getElementById('pager').getElementsByTagName('a');
var bullets=bullets
for (var i=0; i < bullets.length; i++) {
var elem = bullets[i];
elem.setAttribute('data-tab', i);
elem.onclick = function(){
mySwipe.slide(parseInt(this.getAttribute('data-tab'), 10), 500);
}
}
// 高亮点击的数字导航
function slideTab(index){
var i = bullets.length;
while (i--) {
bullets[i].className = bullets[i].className.replace('on',' ');
}
bullets[index].className = 'on';
};